package com.ronan.imweb;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * FileName    : com.ronan.imweb
 * Description :
 *
 * @author : ronan
 * @version : 1.0
 * Create Date : 2021/2/25 14:14
 **/
@Slf4j
@EnableFeignClients
@SpringBootApplication
@MapperScan(value = "com.ronan.imweb.dao")
public class ImWebApplication implements CommandLineRunner {

    @Value("${server.port}")
    private int port;

    @Value("${spring.application.name}")
    private String name;

    public static void main(String[] args) {
        SpringApplication.run(ImWebApplication.class, args);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("{} 服务启动, 服务端口:{}", name, port);
    }
}
